package org.halk.componet;

import lombok.RequiredArgsConstructor;
import org.halk.handle.MyHandle;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

/**
 * @Author halk
 * @Date 2023/7/12 17:23
 */
@Component
//@Order(value = 1) value值越低优先级越高
@RequiredArgsConstructor
public class InitValueRunner implements CommandLineRunner {

    private final MyHandle myHandle;

    @Override
    public void run(String... args) throws Exception {
        System.out.println("CommandLineRunner 可以在启动时预先加载数据");

        myHandle.testRun();
        System.out.println("已调用handle方法！ " + System.currentTimeMillis());
    }
}
